#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {

    char a[1024], b[1024], c[1024];
    int index = 0;

    gets(a);
    gets(b);
    int alen = 0, blen = 0;
    alen = strlen(a);
    blen = strlen(b);
    scanf("%d", &index);
    //将数组a复制到数组c里面
    strcpy(c, a);

    int k = index;

    for (int i = 0; i < blen; i++)
    {
        a[k++] = b[i];
    }

    for (int i = index; i < alen; i++)
    {
        a[k++] = c[i];
    }

    alen = strlen(a);

    for (size_t i = 0; i < alen; i++)
    {
        printf("%c", a[i]);
    }
    
}